package com.csinc.generate.core.base.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 全局的控制器
 * Create By 郭金宝 on 2018/7/23.<br>
 */
@Controller
@RequestMapping("/global")
@Slf4j
public class GlobalController {
    /**
     * 跳转到404页面
     *
     * @author fengshuonan
     */
    @RequestMapping(path = "/error")
    public String errorPage() {
        log.info("----------------------跳转到404页面页面报错了-------------------------");
        return "/404.html";
    }

    /**
     * 跳转到session超时页面
     *
     * @author fengshuonan
     */
    @RequestMapping(path = "/sessionError")
    public String errorPageInfo(Model model) {
        log.info("----------------------session超时了-------------------------");
        model.addAttribute("tips", "session超时");
        return "/login.html";
    }
}
